CAVAREC Image Processing algorithm